import * as React from "react"; import dynamic from "next/dynamic"; import { _getStaticPaths, _getStaticProps, } from "../../../../src/utils/chapterPageMethods"; import type { Context } from "../../../../src/utils/chapterPageMethods"; import Footer from "../../../../src/components/Footer"; import { ChapterProps } from "../../../../src/types/ChapterPage"; import { useEditorContext } from "../../../../src/context/hooks"; const Editor = dynamic(() => import("../../../../src/components/Editor"), { ssr: false, }); export default function Chapter(props: ChapterProps) { const { showAnswer, showDocument, resetState } = useEditorContext(); React.useEffect(() => { resetState(); }, [props.currentChapterId]); const editorProps = { files: props.codeFiles, answerFile: props.answerFile, showAnswer, fileNameToEdit: props.fileNameToEdit, }; return (